package com.example.weizix.presenter;

import com.example.weizix.base.BasePresenter;
import com.example.weizix.base.Constants;
import com.example.weizix.bean.ChapterTabBean;
import com.example.weizix.model.ItInfoModel;
import com.example.weizix.net.ResultCallBack;
import com.example.weizix.view.ItInfoView;

public class ItInfoPresenter extends BasePresenter<ItInfoView> {


    private ItInfoModel mItInfoModel;

    @Override
    protected void initModel() {
        mItInfoModel = new ItInfoModel();
        addModel(mItInfoModel);
    }

    public void getTabData() {
        mItInfoModel.getTab(new ResultCallBack<ChapterTabBean>() {
            @Override
            public void onSuccess(ChapterTabBean chapterTabBean) {
                if (chapterTabBean.getErrorCode() == Constants.SUCCESS_CODE) {
                    view.setTab(chapterTabBean);
                }
            }

            @Override
            public void onFail(String msg) {

            }
        });
    }
}
